import 'dart:convert';

import 'package:dio/dio.dart';

import '../config/dioConfig.dart';


Future<Map> saveCartApi(Map data) async {
  //解析返回结果
  var res = await HttpManager.getInstance().request(
      method:  "post",
      "/cart/save",
      params: data
  );
  return jsonDecode(res.toString());
}

Future<Map> deleteCartApi(Map data) async {
  //解析返回结果
  var res = await HttpManager.getInstance().request(
      method:  "post",
      "/cart/delete",
      params: data
  );
  return jsonDecode(res.toString());
}

Future<Map> getAllCartApi() async {
  var res = await HttpManager.getInstance().get(
    "/cart/getAll",
    option: Options(responseType: ResponseType.plain),
  );
  return jsonDecode(res.toString());
}